<template>
    <div class="upload-single-img" v-if="showImageViewer">
        <el-image-viewer :url-list="[props.urls[props.currentIndex]]" @close="closeImgViewer"/>
    </div>
</template>

<script setup name="readPicture">
import { ref, onMounted, defineProps, defineEmits } from 'vue';
const props = defineProps({
    showImageViewer: Boolean,
    urls: Array,
    currentIndex: Number,
});
const emit = defineEmits(['update:showImageViewer'])
const toggleImageViewer = () => {
    emit('update:showImageViewer', !props.showImageViewer);
};
const closeImgViewer = () => {
    toggleImageViewer();
}
onMounted(() => {
})
</script>